// API 基础URL
export const apiUrl = process.env.NEXT_PUBLIC_API_URL + '/api';

// 获取认证头部函数
export const getAuthHeader = () => {
  const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null;
  console.log('当前token:', token);  // 添加日志
  return {
    headers: {
      Authorization: token ? `Bearer ${token}` : '',
    }
  };
}; 